package city.spring.modules.medicalstation.drugsettings.drugsettingsDrugExt.repository;

import city.spring.modules.medicalstation.drugdepositDrugExt.entity.DrugdepositDrugExtEntity;
import city.spring.modules.medicalstation.drugsettings.drugsettingsDrugExt.entity.DrugsettingsDrugExtEntity;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 存储库：用药设置与药品关联表
 *
 * @author 谢金婷
 * @date 2020-10-15 09:55:17
 */
@Repository
public interface DrugsettingsDrugExtRepository extends BaseMapper<DrugsettingsDrugExtEntity> {
    /**
     * 获取缴存的药品列表
     *
     * @param wrapper 查询对象
     * @return
     */
    List<DrugsettingsDrugExtEntity> getDrugsettings(@Param(Constants.WRAPPER) Wrapper<? extends DrugdepositDrugExtEntity> wrapper);

    /**
     * 获取出库的药品列表
     *
     * @param drugsettingsId 缴存ID
     * @return
     */
    List<DrugsettingsDrugExtEntity> getDrugsettingsDrugs(String drugsettingsId);

    /**
     * 获取出库的某个药品
     *
     * @param drugsettingsId 缴存ID
     * @param extId          主键ID
     * @return
     */
    DrugsettingsDrugExtEntity getDrugsettingsDrug(String drugsettingsId, String extId);

}